package org.ghost.wechat.platform.dto.wechat.menu;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.ghost.wechat.platform.dto.WeChatErrorRspDTO;

import java.io.Serializable;
import java.util.List;

/**
 * @author 01
 */
public class WeChatGetMenuRspDTO extends WeChatErrorRspDTO {
    private static final long serialVersionUID = 3417770422757710321L;

    private WeChatGetMenuItemDTO menu;
    private WeChatGetMenuItemDTO conditionalMenu;

    public WeChatGetMenuItemDTO getMenu() {
        return menu;
    }

    public void setMenu(WeChatGetMenuItemDTO menu) {
        this.menu = menu;
    }

    @JsonProperty(value = "conditionalmenu")
    public WeChatGetMenuItemDTO getConditionalMenu() {
        return conditionalMenu;
    }

    @JsonProperty(value = "conditionalmenu")
    public void setConditionalMenu(WeChatGetMenuItemDTO conditionalMenu) {
        this.conditionalMenu = conditionalMenu;
    }

    @Override
    public String toString() {
        return "WeChatGetMenuRspDTO{" +
                "menu=" + menu +
                ", conditionalMenu=" + conditionalMenu +
                ", errCode=" + errCode +
                ", errMsg='" + errMsg + '\'' +
                '}';
    }

    public static class WeChatGetMenuItemDTO implements Serializable {
        private static final long serialVersionUID = 2542622293097078008L;

        private String menuId;
        private List<WeChatMenuDTO> button;
        private WeChatMenuRuleDTO matchRule;

        @JsonProperty(value = "menuid")
        public String getMenuId() {
            return menuId;
        }

        @JsonProperty(value = "menuid")
        public void setMenuId(String menuId) {
            this.menuId = menuId;
        }

        public List<WeChatMenuDTO> getButton() {
            return button;
        }

        public void setButton(List<WeChatMenuDTO> button) {
            this.button = button;
        }

        @JsonProperty(value = "matchrule")
        public WeChatMenuRuleDTO getMatchRule() {
            return matchRule;
        }

        @JsonProperty(value = "matchrule")
        public void setMatchRule(WeChatMenuRuleDTO matchRule) {
            this.matchRule = matchRule;
        }

        @Override
        public String toString() {
            return "WeChatGetMenuItemDTO{" +
                    "menuId='" + menuId + '\'' +
                    ", button=" + button +
                    ", matchRule=" + matchRule +
                    '}';
        }
    }
}
